! namelist 读取有顺序要求

program name 
implicit none
integer :: i, j, k, l
namelist /one/ i, j
namelist /two/ k, l

i = 1; j = 2
k =3; l =4

! open(unit=10, file='output', status='old', action='write')
! write(10,nml=one)
! write(10,nml=two)

open(unit=10, file='output', status='old', action='read')
read(10,nml=one)
write(*,nml=one) 

read(10, nml=two)
write(*,nml=two) 

close(10)

end program name 